<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
		<title>办事指南-办理地点</title>
		<link rel="stylesheet" href="../../css/mui.min.css">
		<link rel="stylesheet" href="../../css/app.css">
		<style>
			body{background: #fff;overflow: auto;}
			.mui-bar{width:7.5rem;}
			.mui-bar-nav .mui-pull-right{display: block;width:0.38rem;height: 0.38rem;background: url(../../images/work/share.png) no-repeat center center;background-size: contain;margin-right: 0.26rem !important;margin-top: 0.28rem !important;}
			.mui-bar-nav .right1{display: block;width:0.38rem;height: 0.38rem;background: url(../../images/work/star1.png) no-repeat center center;background-size: contain;margin-right: 0 !important;}
			.mui-table-view{margin: 0 !important;padding: 0 !important;width: 7.5rem;  /*  margin-top: 0.9rem !important;*/}
			.mui-table-view-cell:after,.mui-table-view:after{left: 0;height: 0.15rem;background: #eeeeee;}
			.mui-table-view .mui-table-view-cell{padding: 0.32rem 0.29rem 0.36rem 0.24rem;}
			.mui-table-view .mui-table-view-cell .title{float: left;display:block;width: 0.6rem;min-height: 1.35rem;padding-bottom: 0.1rem;background: #ff8400;color: #fff;border-radius: 0.1rem;font-size: 0.28rem;padding-left: 0.16rem;padding-top: 0.18rem;line-height: 0.32rem;}
			.mui-table-view .mui-table-view-cell .adr_tim{float: right;width: 6.19rem;position: relative;margin-top: 0.1rem;}
			.mui-table-view .mui-table-view-cell .adr_tim .address{font-size: 0.30rem;padding-right: 0.6rem;}
			.mui-table-view .mui-table-view-cell .adr_tim .time{font-size: 0.28rem;color: #666666;}
			.mui-table-view .mui-table-view-cell .adr_tim img{width: 0.5rem;position: absolute;/*bottom: 0.08rem;*/right: 0;top: -0.2rem;}
			.mui-table-view-cell.mui-active{background: #fff;}
		</style>
	</head>
	<body>
		<ul class="mui-table-view" id='app'>
			<template v-if='location_show' v-for="blLocation in locationList">
			    <li class="mui-table-view-cell">
			    	<div class="title" v-if='blLocation.locationType ==="0" '>大厅 </div>
			    	<div class="title" v-else>办公室</div>
			    	<div class="adr_tim">
			    		<div class="address">{{blLocation.locationAddr}}</div>
			    		<div class="time">{{blLocation.acceptDate}}</div>
					<img :name="blLocation.locationName" :longitude="blLocation.longitude" :latitude="blLocation.latitude" src="../../images/menu/map1.png"/>
			    	</div>
			    </li>
		    </template>
		</ul>
	</body>
	<script>
		function my_immersed(immersed){
			//document.getElementById("header").style.marginTop = immersed + 'px';
			document.getElementById("app").style.paddingTop = immersed + 'px';
		}
	</script>
	<script src="../../js/immersed.js"></script>
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/common.js"></script>
	<script src="../../js/vue.min.js"></script>
	<script src="../../js/jquery2.2.4.min.js"></script>
	<script src="../../js/app.js"></script>
	<script>
		var extendOid = utils.getUrlParam('extendOid');//从上个页面传过来的事项扩展表id
		mui.init()
		
		mui.plusReady(function(){
			closeWaitingAndShowView(); 
		});
	
		var vm = new Vue({
			  el: '#app',
			  data: {
			  	location_show:false,
			  	locationList:[{handleLocationOid:'',locationName:'',locationAddr:'',acceptDate:'',longitude:'',latitude:'',locationType:''}]//办理地点list
			  } 
		});
		
		//ajax 办件查询详细信息
		var param = 'extendOid='+extendOid;
		utils.ajax('appHttpService/appLocationList.do', function(data) {
			data = JSON.parse(data);
			if(data.code == '1'){
				mui.toast('系统内部错误');
				return;
			}else{
				var locationList = JSON.parse(data.result);
				if(locationList != null){
					var size = locationList.length;
					if(size>0){
						vm.location_show = true;
						vm.locationList = locationList;
					}
				}
			}
		}, param);
		var location_wv = null;
		//地图定位
		mui('#app').on('tap', 'img', function() {
			var locationId = this.getAttribute('locationId');
			var longitude = this.getAttribute('longitude');
			var name = this.getAttribute('name');
			var titleNView = { //详情页原生导航配置
				backgroundColor: '#f7f7f7', //导航栏背景色
				type:'transparent',
				titleText: '地图定位', //导航栏标题
				titleColor: '#000000', //文字颜色
				autoBackButton: true, //自动绘制返回箭头
				splitLine: { //底部分割线
					color: '#cccccc'
				}
			}
			
			var url = "https://map.baidu.com/mobile/webapp/place/linesearch/foo=bar/from=place&end=word="+name+"&point="+locationId+","+longitude+"&tab=line/?fromhash=1";
			url = encodeURI(url);
			openNewWin(url,{"titleNView": titleNView,"top":immersed + 'px'},'location_map')
			
			setTimeout(function () {
				location_wv = plus.webview.getWebviewById('location_map');
				location_wv.show("slide-in-right", 300);
				var old_back = mui.back;
				mui.back = function(){
					if(location_wv.isVisible()){
						location_wv.hide();
						location_wv.close();
					}else{
						old_back();
					}
				}
			},150);
		});

		
		
	</script>
</html>